package sk.tuke.client.components.forms;

import com.smartgwt.client.widgets.form.fields.TextItem;

public class DataSourceTextField extends com.smartgwt.client.data.fields.DataSourceTextField {

	TextItem textItem;

	public DataSourceTextField(String name, boolean required) {
	}

	public DataSourceTextField(int width, int height, String name, String title, Integer length, boolean required)  {
		textItem = new TextItem();
		textItem.setHeight(height);
		textItem.setWidth(width);
		textItem.setRequired(required);
		textItem.setName(name);
		textItem.setTitle(title);
		if (length != null) {
			textItem.setLength(length);
		}
		this.setRequired(required);
		this.setName(name);
		this.setEditorType(textItem);
	}

	public TextItem getTextItem() {
		return textItem;
	}

	public void setTextItem(TextItem textItem) {
		this.setEditorType(textItem);
	}
	
	

}
